using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using DataAccess.Entities;
using DataAccess.Mapping;

namespace DataAccess
{
	public class CompanyDicContext : DbContext
	{
		static CompanyDicContext()
		{ 
			Database.SetInitializer<CompanyDicContext>(null);
		}

		public DbSet<Area> Areas { get; set; }
		public DbSet<Category> Categories { get; set; }
		public DbSet<Comment> Comments { get; set; }
		public DbSet<Industry> Industries { get; set; }
		public DbSet<Kind> Kinds { get; set; }
		public DbSet<Organization> Organizations { get; set; }
		public DbSet<OrganizationTemp> OrganizationTemps { get; set; }
		public DbSet<OrgBrief> OrgBriefs { get; set; }
		public DbSet<OrgBriefTemp> OrgBriefTemps { get; set; }
		public DbSet<Size> Sizes { get; set; }
		public DbSet<User> Users { get; set; }
		public DbSet<UserTrack> UserTracks { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
		{
            modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
			modelBuilder.Configurations.Add(new AreaMap());
			modelBuilder.Configurations.Add(new CategoryMap());
			modelBuilder.Configurations.Add(new CommentMap());
			modelBuilder.Configurations.Add(new IndustryMap());
			modelBuilder.Configurations.Add(new KindMap());
			modelBuilder.Configurations.Add(new OrganizationMap());
			modelBuilder.Configurations.Add(new OrganizationTempMap());
			modelBuilder.Configurations.Add(new OrgBriefMap());
			modelBuilder.Configurations.Add(new OrgBriefTempMap());
			modelBuilder.Configurations.Add(new SizeMap());
			modelBuilder.Configurations.Add(new UserMap());
			modelBuilder.Configurations.Add(new UserTrackMap());
		}
	}
}

